<!--
 ! Excerpted from "Code in the Cloud",
 ! published by The Pragmatic Bookshelf.
 ! Copyrights apply to this code. It may not be used to create training material, 
 ! courses, books, articles, and the like. Contact us if you are in doubt.
 ! We make no guarantees that this code is fit for any purpose. 
 ! Visit http://www.pragmaticprogrammer.com/titles/mcappe for more book information.
-->
{% extends master.html %}

{% block pagecontent %}

{% for m in msg_list %}

  {% ifequal msg.sender m.user %} <!-- (1) -->
  <p class="sentbyme">
  {% else %}
  <p class="sentbyother">
  {% endifequal %}

   <b>({{ m.chat }})</b> {{ m.user }} ( {{ m.timestamp }} ): 
      {{ m.message | escape }} </p>

{% endfor %}

    <form action="/talk&chat={{ chat }}" method="post"> 
      <p><b>Message</b></p>
      <div><textarea name="message" rows="5" cols="60"></textarea></div>
      <div><input type="submit" value="Send ChatMessage"/></div>
    </form>

{% endblock %}


